<?php
/* 
 *供应商_产品关联管理
 */
class Supplier_product_classAction extends CommonAction {
    public function insert()
    {
        $_POST['supplier_id'] = $_GET['supplier_id'];
        $_POST['product_class_id'] = $_GET['product_class_id'];
        $map = array(
            'supplier_id' => $_GET['supplier_id'],
            'product_class_id' => $_GET['product_class_id'],
            );
        $jumpUrl = __APP__.'/Supplier/product_class/id/'.$_GET['supplier_id'];
        $rs = M('Supplier_product')->where($map)->findAll();
        if(!is_array($rs))
            parent::insert($jumpUrl);
        else
            $this->error("该供应商已经有此产品类别！");
    }
}
?>
